﻿// See https://aka.ms/new-console-template for more information
using DataConverter;
using DataConverter.Core;

public class Program
{
    public static void Main(string[] args)
    {
        // GameBoxDemoTest(args);
        //SqlServerConnectionDemo.Test();
        //ConsoldeTest();

        Console.WriteLine("AppDomain.CurrentDomain.BaseDirectory: \n" + AppDomain.CurrentDomain.BaseDirectory);
        Console.WriteLine("Path.GetFullPath('.'): \n" + Path.GetFullPath("."));

        //C2021T02_cvinet cvinet = new C2021T02_cvinet();
        //cvinet.OnStart();
        //cvinet.OneLoop_Process();
        //cvinet.OnStopped();

        //C2021T08_Kisler kisler = new C2021T08_Kisler();
        //kisler.OnStart();
        //kisler.OneLoop_Process();
        //kisler.OnStopped();

        //C2021T09_Excel excel = new C2021T09_Excel();
        //excel.OneLoop_Process();

        //C2021T03_CTL ctl =new C2021T03_CTL();
        //ctl.OnStart();
        //ctl.OneLoop_Process();
        //ctl.OnStopped();

        //C2021T04_DisenNVH disennvh = new C2021T04_DisenNVH();
        //disennvh.OnStart();
        //disennvh.OneLoop_Process();
        //disennvh.OnStopped();

        C2021T01_Atlas atlas = new C2021T01_Atlas();
        atlas.OnStart();
        atlas.OneLoop_Process();
        atlas.OnStopped();

    }


    public static void GameBoxDemoTest(string[] args)
    {
        var xlsx_file = args.Length > 0 ? args[0] : "test.xls";
        if (!File.Exists(xlsx_file))
            GameBoxDemo.Test();
    }

    public static void ConsoldeTest()
    {
        var path = Path.GetFullPath(".");
        path = AppContext.BaseDirectory;
        var pyfile = Path.Join(path, "hello.py");
        Console.WriteLine($"path = {path}");
        Console.WriteLine($"pyfile = {pyfile}");

        Console.WriteLine("Test1: " + ConsoleInvoker.RunCommand("python", pyfile));
        Console.WriteLine("Test2: " + ConsoleInvoker.RunCommand("python", pyfile + " Jack"));
    }
}
